import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import('@/views/index.vue')
  },
  {
    path: "/userCenter",
    name: "userCenter",
    component: () => import('@/views/userCenter.vue'),
    children: [
      {
        path:"comp",
        component: () => import('@/views/comp')
      },
      {
        path:"edit",
        component: () => import('@/views/comp/edit')
      },
      {
        path:"role",
        component: () => import('@/views/role')
      },
      {
        path:"role_edit",
        component: () => import('@/views/role/edit')
      },
      {
        path:"pro",
        component: () => import('@/views/pro')
      },
      {
        path:"examine",
        component: () => import('@/views/examine')
      },
    ]
  }
  , {
    path: "/login/:role",
    name: "login",
    component: () => import('@/views/login.vue')
  },
  {
    path: "/articalDetail",
    name: "articalDetail",
    component: () => import('@/views/articalDetail.vue')
  }, {
    path: "/compDetail",
    name: "compDetail",
    component: () => import('@/views/comp/compDetail.vue')
  }, {
    path: "/person",
    name: "person",
    component: () => import('@/views/person.vue')
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
